import request from '@/utils/request'

// 获取交班列表
export function getShiftHandoverList(params) {
  return request({
    url: '/operation/web/records/shift_handover_list',
    method: 'get',
    params
  })
}

// 创建交班记录
export function createShiftHandover(data) {
  return request({
    url: '/operation/web/records/shift_handover',
    method: 'post',
    data
  })
}

// 修改交班记录
export function updateShiftHandover(data) {
  return request({
    url: '/operation/web/records/shift_handover',
    method: 'put',
    data
  })
}

// 删除交班记录
export function deleteShiftHandover(id) {
  return request({
    url: `/operation/web/records/shift_handover/${id}`,
    method: 'delete'
  })
}

// 获取用户下拉列表
export function getUserList() {
  return request({
    url: '/operation/web/records/userList',
    method: 'get'
  })
}

// 获取交班详细信息
export function getShiftHandoverDetail(id) {
  return request({
    url: `/operation/web/records/shift_handover/${id}`,
    method: 'get'
  })
}

// 获取交接班详细信息
export function getShiftSuccessionDetail(id) {
  return request({
    url: `/operation/web/records/shift_succession/${id}`,
    method: 'get'
  })
}